From: Ian Campbell Date: Wed, 25 Oct 2006 12:58:30 +0000 (+0100) Subject: PV-on-HVM: Kernels prior to 2.6.8 did not export strcspn to modules X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15584^2~11 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=4bfff95df70a42b4540928566e664c0349cbd8cc;p=xen.git PV-on-HVM: Kernels prior to 2.6.8 did not export strcspn to modules therefore implement our own and export it. Signed-off-by: Ian Campbell Signed-off-by: K. Y. Srinivasan Signed-off-by: Tsunehisa Doi --- diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c index c6fa5b81da..6538964ecf 100644 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c @@ -9,3 +9,23 @@ static int system_state = 1; EXPORT_SYMBOL(system_state); #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) +size_t strcspn(const char *s, const char *reject) +{ + const char *p; + const char *r; + size_t count = 0; + + for (p = s; *p != '\0'; ++p) { + for (r = reject; *r != '\0'; ++r) { + if (*p == *r) + return count; + } + ++count; + } + + return count; +} +EXPORT_SYMBOL(strcspn); +#endif